package org.raymond.iworks.study.flowable;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.repository.Deployment;

@Slf4j
public class HolidayRequest {
    private static RuntimeService runtimeService;
    private static TaskService taskService;
    private static RepositoryService repositoryService;
    private static HolidayRequest instance;

    private HolidayRequest(RuntimeService runtimeService, TaskService taskService){
        this.runtimeService = runtimeService;
        this.taskService = taskService;
    }

    public static synchronized HolidayRequest instance(RuntimeService runtimeService, TaskService taskService){
        if(instance==null){
            instance = new HolidayRequest(runtimeService, taskService);
        }
        return instance;
    }




    //@Test
    public void holidayRequest(){
        Deployment deployment = repositoryService.createDeployment()
                .addClasspathResource("flowable/holiday-request.bpmn20.xml")
                .deploy();
    }
}
